<?php

class ItsType extends AppModel {
    var $name = 'ItsType';

    var $belongsTo = array(
            'User' => array(
                'foreignKey' => 'collector_id',
                'fields' => array('name')
            ),
    );

    var $validate = array(
        'code' => array(
                'notEmpty' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'Type code is required.',
                    'required' => true,
            ),
                'isUnique' => array(
                    'rule' => 'isUnique',
                    'message' => 'This type code is already taken.',
            ),
        ),
        'name' => array(
                'notEmpty' => array(
                    'rule' => array('notEmpty'),
                    'message' => 'Type name is required.',
                    'required' => true,
            ),
                'isUnique' => array(
                    'rule' => 'isUnique',
                    'message' => 'This type name is already taken.',
            ),
        ),
    );


}
?>
